<?php
session_start();
if(isset($_SESSION['lang']))
    require_once "./language_files/sort_coauthors" . $_SESSION['lang'] . ".php";
else
    require_once "./language_files/sort_coauthors_en.php";
require_once "functions.php";
if(isset($_POST['menu']))
{
    $menu=$_POST['menu'];
    for($i=0; $i < count($menu); $i++)
    {
        mysql_query("UPDATE `co_authors` SET `sort`=" . $i . " WHERE `id`='" . $menu[$i] . "'") or die(mysql_error());
    }
    echo '1';
}
else
{
    echo $lang['title_1'];
}
?>
